<!DOCTYPE html>












  


<html class="theme-next gemini use-motion" lang="zh-CN">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"/>
<meta name="theme-color" content="#222">












<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />






















<link href="/little-eight-china.github.io/lib/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />

<link href="/little-eight-china.github.io/css/main.css?v=6.3.0" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/little-eight-china.github.io/images/apple-touch-icon-next.png?v=6.3.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/little-eight-china.github.io/images/favicon-32x32-next.png?v=6.3.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/little-eight-china.github.io/images/favicon-16x16-next.png?v=6.3.0">


  <link rel="mask-icon" href="/little-eight-china.github.io/images/logo.svg?v=6.3.0" color="#222">









<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/little-eight-china.github.io/',
    scheme: 'Gemini',
    version: '6.3.0',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":true,"scrollpercent":false,"onmobile":false},
    fancybox: false,
    fastclick: false,
    lazyload: false,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>


  




  <meta name="description" content="Linux的基本命令入门目录切换命令目录结构 / (根目录) bin（binaries）存放二进制可执行文件 boot 存放用于系统引导时使用的各种文件 dev （devices）用于存放设备文件 etc （etcetera）存放系统配置文件 home 存放用户文件的根目录 每个用户的根目录的存放的位置，home下创建每个用户的根目录。 例如：用户是test，那么在home下就会存在一个叫test">
<meta name="keywords" content="little_eight">
<meta property="og:type" content="article">
<meta property="og:title" content="Linux的基本命令入门">
<meta property="og:url" content="http://yoursite.com/2018/09/27/Linux的基本命令入门/index.html">
<meta property="og:site_name" content="八达博客">
<meta property="og:description" content="Linux的基本命令入门目录切换命令目录结构 / (根目录) bin（binaries）存放二进制可执行文件 boot 存放用于系统引导时使用的各种文件 dev （devices）用于存放设备文件 etc （etcetera）存放系统配置文件 home 存放用户文件的根目录 每个用户的根目录的存放的位置，home下创建每个用户的根目录。 例如：用户是test，那么在home下就会存在一个叫test">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/add.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/query.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/q21.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/query2.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/mv.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/move.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/copy.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/delete1.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/delete2.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/add2.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/query3.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/query4.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/query5.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/query6.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/dabao1.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/jieya1.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/jieya2.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/sousuo1.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/sousuo2.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/sousuo.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/ifconfig.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/ping.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/nes.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/quanxian0.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/quanxian.png">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/quanxian2.jpg">
<meta property="og:image" content="http://pd6p053wl.bkt.clouddn.com/chmod.png">
<meta property="og:updated_time" content="2019-02-27T13:41:58.855Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Linux的基本命令入门">
<meta name="twitter:description" content="Linux的基本命令入门目录切换命令目录结构 / (根目录) bin（binaries）存放二进制可执行文件 boot 存放用于系统引导时使用的各种文件 dev （devices）用于存放设备文件 etc （etcetera）存放系统配置文件 home 存放用户文件的根目录 每个用户的根目录的存放的位置，home下创建每个用户的根目录。 例如：用户是test，那么在home下就会存在一个叫test">
<meta name="twitter:image" content="http://pd6p053wl.bkt.clouddn.com/add.png">






  <link rel="canonical" href="http://yoursite.com/2018/09/27/Linux的基本命令入门/"/>



<script type="text/javascript" id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  <title>Linux的基本命令入门 | 八达博客</title>
  









  <noscript>
  <style type="text/css">
    .use-motion .motion-element,
    .use-motion .brand,
    .use-motion .menu-item,
    .sidebar-inner,
    .use-motion .post-block,
    .use-motion .pagination,
    .use-motion .comments,
    .use-motion .post-header,
    .use-motion .post-body,
    .use-motion .collection-title { opacity: initial; }

    .use-motion .logo,
    .use-motion .site-title,
    .use-motion .site-subtitle {
      opacity: initial;
      top: initial;
    }

    .use-motion {
      .logo-line-before i { left: initial; }
      .logo-line-after i { right: initial; }
    }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/little-eight-china.github.io/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">八达博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">
    <a href="/little-eight-china.github.io/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-home"></i> <br />首页</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">
    <a href="/little-eight-china.github.io/archives/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />归档<span class="badge">15</span></a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">
    <a href="/little-eight-china.github.io/categories/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-th"></i> <br />分类<span class="badge">4</span></a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">
    <a href="/little-eight-china.github.io/tags/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />标签<span class="badge">2</span></a>
  </li>

      
      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />搜索</a>
        </li>
      
    </ul>
  

  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off"
             placeholder="搜索..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



  



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/little-eight-china.github.io/2018/09/27/Linux的基本命令入门/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/little-eight-china.github.io/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="八达博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Linux的基本命令入门
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">

            
            
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2018-09-27 20:30:42" itemprop="dateCreated datePublished" datetime="2018-09-27T20:30:42+00:00">2018-09-27</time>
            

            
              

              
                
                <span class="post-meta-divider">|</span>
                

                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2019-02-27 13:41:58" itemprop="dateModified" datetime="2019-02-27T13:41:58+00:00">2019-02-27</time>
              
            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/little-eight-china.github.io/categories/杂类/" itemprop="url" rel="index"><span itemprop="name">杂类</span></a></span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="Linux的基本命令入门"><a href="#Linux的基本命令入门" class="headerlink" title="Linux的基本命令入门"></a>Linux的基本命令入门</h1><h2 id="目录切换命令"><a href="#目录切换命令" class="headerlink" title="目录切换命令"></a>目录切换命令</h2><h3 id="目录结构"><a href="#目录结构" class="headerlink" title="目录结构"></a>目录结构</h3><ul>
<li>/ (根目录)<ul>
<li>bin（binaries）存放二进制可执行文件</li>
<li>boot 存放用于系统引导时使用的各种文件</li>
<li>dev （devices）用于存放设备文件</li>
<li>etc （etcetera）存放系统配置文件</li>
<li>home 存放用户文件的根目录<ul>
<li>每个用户的根目录的存放的位置，home下创建每个用户的根目录。</li>
<li>例如：用户是test，那么在home下就会存在一个叫test的目录</li>
</ul>
</li>
<li>lib （library）存放跟文件系统中的程序运行所需要的共享库及内核模块</li>
<li>sbin （super user binaries）存放二进制可执行文件，只有root才能访问</li>
<li>usr （unix shared resources）用于存放共享的系统资源</li>
<li>var （variable）用于存放运行时需要改变数据的文件</li>
<li>…<h3 id="目录切换命令-1"><a href="#目录切换命令-1" class="headerlink" title="目录切换命令"></a>目录切换命令</h3>cd usr        切换到该目录下usr目录<br>cd ../        切换到上一层目录<br>cd /        切换到系统根目录<br>cd ~        切换到用户主目录<br>cd -        切换到上一个所在目录<a id="more"></a>
<h2 id="目录的操作命令"><a href="#目录的操作命令" class="headerlink" title="目录的操作命令"></a>目录的操作命令</h2><h3 id="增加目录操作"><a href="#增加目录操作" class="headerlink" title="增加目录操作"></a>增加目录操作</h3>命令：mkdir 目录名称<br>示例：在根目录 / 下 mkdir test，就会在根目录 /下产生一个test问目录<br><img src="http://pd6p053wl.bkt.clouddn.com/add.png" alt="Alt"><h3 id="查看目录"><a href="#查看目录" class="headerlink" title="查看目录"></a>查看目录</h3>命令：ls [-al] 父目录<br>示例：在根目录 / 下使用ls，可以看到该目录下的所有的目录和文件<br><img src="http://pd6p053wl.bkt.clouddn.com/query.png" alt="Alt"><br>示例：在根目录 / 下使用ls -a，可以看到该目录下的所有文件和目录，包括隐藏的<br><img src="http://pd6p053wl.bkt.clouddn.com/q21.png" alt="Alt"><br>示例：在根目录 / 下使用ls -l（ls -l 可以缩写成ll），可以看到该目录下的所有目录和文件的详细信息<br><img src="http://pd6p053wl.bkt.clouddn.com/query2.png" alt="Alt"><h3 id="寻找目录"><a href="#寻找目录" class="headerlink" title="寻找目录"></a>寻找目录</h3>命令：find 目录 参数<br>示例：查找/root下的与test相关的目录(文件)  find /root -name ‘test*’<h3 id="修改目录的名称"><a href="#修改目录的名称" class="headerlink" title="修改目录的名称"></a>修改目录的名称</h3>命令：mv 目录名称 新目录名称（注意：mv的语法不仅可以对目录进行重命名而且也可以对各种文件，压缩包等进行    重命名的操作）<br>示例：test目录下有一个oldTest目录，使用mv oldTest newTest命令修改<br><img src="http://pd6p053wl.bkt.clouddn.com/mv.png" alt="Alt"><h3 id="移动目录的位置—剪切"><a href="#移动目录的位置—剪切" class="headerlink" title="移动目录的位置—剪切"></a>移动目录的位置—剪切</h3>命令：mv 目录名称 目录的新位置（注意：mv语法不仅可以对目录进行剪切操作，对文件和压缩包等都可执行剪切操作）<br>示例：在test下将newTest目录剪切到 /usr下面，使用mv newTest /usr<br><img src="http://pd6p053wl.bkt.clouddn.com/move.png" alt="Alt"></li>
</ul>
</li>
</ul>
<h3 id="拷贝目录"><a href="#拷贝目录" class="headerlink" title="拷贝目录"></a>拷贝目录</h3><p>命令：cp -r 目录名称 目录拷贝的目标位置 —–r代表递归拷贝（注意：cp命令不仅可以拷贝目录还可以拷贝文件，压缩包等，拷贝文件和压缩包时不    用写-r递归）<br>示例：将/usr下的newTest拷贝到根目录下的test中，使用cp -r /usr/newTest /test<br><img src="http://pd6p053wl.bkt.clouddn.com/copy.png" alt="Alt"></p>
<h3 id="删除目录"><a href="#删除目录" class="headerlink" title="删除目录"></a>删除目录</h3><p>命令：rm [-rf] 目录<br>示例：删除/usr下的newTest，进入/usr下使用rm -r newTest<br><img src="http://pd6p053wl.bkt.clouddn.com/delete1.png" alt="Alt"><br>示例：删除/test下的newTest而不需要询问强制删除，在/test下使用rm -rf newTest<br><img src="http://pd6p053wl.bkt.clouddn.com/delete2.png" alt="Alt"><br>注意：rm不仅可以删除目录，也可以删除其他文件或压缩包，为了增强大家的记忆，无论删除任何目录或文件，都直接使用rm -rf 目录/文件/压缩包</p>
<h2 id="文件的操作命令"><a href="#文件的操作命令" class="headerlink" title="文件的操作命令"></a>文件的操作命令</h2><h3 id="文件的创建"><a href="#文件的创建" class="headerlink" title="文件的创建"></a>文件的创建</h3><p>命令：touch 文件名称  —– 空文件<br>示例：在test目录下创建一个空文件 touch aaa.txt<br><img src="http://pd6p053wl.bkt.clouddn.com/add2.png" alt="Alt"></p>
<h3 id="文件的查看"><a href="#文件的查看" class="headerlink" title="文件的查看"></a>文件的查看</h3><p>命令：cat/more/less/tail 文件<br>示例：使用cat查看/etc/sudo.conf文件，只能显示最后一屏内容<br><img src="http://pd6p053wl.bkt.clouddn.com/query3.png" alt="Alt"><br>示例：使用more查看/etc/sudo.conf文件，可以显示百分比，回车可以向下一行，    空格可以向下一页，q可以退出查看<br><img src="http://pd6p053wl.bkt.clouddn.com/query4.png" alt="Alt"><br>示例：使用less查看/etc/sudo.conf文件，可以使用键盘上的PgUp和PgDn向上    和向下翻页，q结束查看<br><img src="http://pd6p053wl.bkt.clouddn.com/query5.png" alt="Alt"><br>示例：使用tail -10 查看/etc/sudo.conf文件的后10行，Ctrl+C结束<br><img src="http://pd6p053wl.bkt.clouddn.com/query6.png" alt="Alt"><br>注意：命令 tail -f 文件 可以对某个文件进行动态监控，例如tomcat的日志文件，    会随着程序的运行，日志会变化，可以使用tail -f catalina-2018-11-11.log 监控    文件的变化 </p>
<h3 id="修改文件的内容"><a href="#修改文件的内容" class="headerlink" title="修改文件的内容"></a>修改文件的内容</h3><p>命令：vim 文件<br>示例：编辑/test下的aaa.txt文件，使用vim aaa.txt<br>进入文件内容后，此时并不能编辑，因为此时处于命令模式，点击键盘i/a/o进入编辑模式，可以    编辑文件。编辑完成后，按下Esc，退回命令模式，此时文件虽然已经编辑完成，但是没有保存，需输入冒号：进入底行模式，在底行模    式下输入wq代表写入内容并退出，即保存；输入q!代表强制退出不保存。<br>关于vim使用过程：<br>在实际开发中，使用vim编辑器主要作用就是修改配置文件<br>vim 文件——&gt;进入文件—–&gt;命令模式——&gt;按i进入编辑模式—–&gt;编辑文件    ——-&gt;按Esc进入底行模式—–&gt;输入:wq/q!<br>（关于vim的操作，这里只做最简单的阐述）</p>
<h2 id="压缩文件的操作命令"><a href="#压缩文件的操作命令" class="headerlink" title="压缩文件的操作命令"></a>压缩文件的操作命令</h2><h3 id="打包并压缩文件"><a href="#打包并压缩文件" class="headerlink" title="打包并压缩文件"></a>打包并压缩文件</h3><p>Linux中的打包文件一般是以.tar结尾的，压缩的命令一般是以.gz结尾的。<br>而一般情况下打包和压缩是一起进行的，打包并压缩后的文件的后缀名一般.tar.gz。<br>命令：tar -zcvf 打包压缩后的文件名 要打包压缩的文件<br>其中：z：调用gzip压缩命令进行压缩<br>  c：打包文件<br>  v：显示运行过程<br>  f：指定文件名<br>示例：打包并压缩/test下的所有文件 压缩后的压缩包指定名称为xxx.tar.gz<br>tar -zcvf xxx.tar.gz aaa.txt bbb.txt ccc.txt<br>或：tar -zcvf xxx.tar.gz /test/*<br><img src="http://pd6p053wl.bkt.clouddn.com/dabao1.png" alt="Alt"></p>
<h3 id="解压压缩包"><a href="#解压压缩包" class="headerlink" title="解压压缩包"></a>解压压缩包</h3><p>命令：tar [-xvf] 压缩文件<br>其中：x：代表解压<br>示例：将/test下的xxx.tar.gz解压到当前目录下<br>tar -xvf xxx.tar.gz<br><img src="http://pd6p053wl.bkt.clouddn.com/jieya1.png" alt="Alt"><br>示例：将/test下的xxx.tar.gz解压到根目录/usr下<br>tar -xvf xxx.tar.gz -C /usr——C代表指定解压的位置<br><img src="http://pd6p053wl.bkt.clouddn.com/jieya2.png" alt="Alt"></p>
<h2 id="其他命令"><a href="#其他命令" class="headerlink" title="其他命令"></a>其他命令</h2><h3 id="显示当前所在位置"><a href="#显示当前所在位置" class="headerlink" title="显示当前所在位置"></a>显示当前所在位置</h3><p>命令：pwd<br><img src="" alt="Alt"></p>
<h3 id="搜索命令"><a href="#搜索命令" class="headerlink" title="搜索命令"></a>搜索命令</h3><p>命令：grep 要搜索的字符串 要搜索的文件<br>示例：搜索/usr/sudu.conf文件中包含字符串to的行<br><img src="http://pd6p053wl.bkt.clouddn.com/sousuo1.png" alt="Alt"><br>示例：搜索/usr/sudu.conf文件中包含字符串to的行 to要高亮显示<br><img src="http://pd6p053wl.bkt.clouddn.com/sousuo2.png" alt="Alt"></p>
<h3 id="管道命令"><a href="#管道命令" class="headerlink" title="管道命令"></a>管道命令</h3><p>命令：|   将前一个命令的输出作为本次目录的输入<br>示例：查看当前系统中所有的进程中包括system字符串的进程<br><img src="http://pd6p053wl.bkt.clouddn.com/sousuo.png" alt="Alt"></p>
<h3 id="查看进程"><a href="#查看进程" class="headerlink" title="查看进程"></a>查看进程</h3><p>命令：ps -ef<br>示例：查看当前系统中运行的进程 </p>
<h3 id="杀死进程"><a href="#杀死进程" class="headerlink" title="杀死进程"></a>杀死进程</h3><p>命令：kill -9 进程的pid</p>
<h3 id="网络通信命令"><a href="#网络通信命令" class="headerlink" title="网络通信命令"></a>网络通信命令</h3><p>查看当前系统的网卡信息：ifconfig<br><img src="http://pd6p053wl.bkt.clouddn.com/ifconfig.png" alt="Alt"></p>
<p>查看与某台机器的连接情况：ping<br><img src="http://pd6p053wl.bkt.clouddn.com/ping.png" alt="Alt"><br>查看当前系统的端口使用：netstat -an<br><img src="http://pd6p053wl.bkt.clouddn.com/nes.png" alt="Alt"></p>
<h1 id="Linux的权限命令"><a href="#Linux的权限命令" class="headerlink" title="Linux的权限命令"></a>Linux的权限命令</h1><h2 id="权限说明"><a href="#权限说明" class="headerlink" title="权限说明"></a>权限说明</h2><p>权限是Linux中的重要概念，每个文件/目录等都具有权限，通过ls -l命令我们可以    查看某个目录下的文件或目录的权限<br>示例：在随意某个目录下ls -l（用缩写。。这里为了美观）<br><img src="http://pd6p053wl.bkt.clouddn.com/quanxian0.png" alt="Alt"><br>第一列的内容的信息解释如下：<br><img src="http://pd6p053wl.bkt.clouddn.com/quanxian.png" alt="Alt"></p>
<ul>
<li>文件的类型:<ul>
<li>d：代表目录</li>
<li>-：代表文件</li>
<li>l：代表链接（可以认为是window中的快捷方式）</li>
<li>l：代表链接（可以认为是window中的快捷方式）<br>后面的9位分为3组，每3位置一组，分别代表属主的权限，与当前用户同组的    用户的权限，其他用户的权限</li>
<li>r：代表权限是可读，r也可以用数字4表示</li>
<li>w：代表权限是可写，w也可以用数字2表示</li>
<li>x：代表权限是可执行，x也可以用数字1表示<br><img src="http://pd6p053wl.bkt.clouddn.com/quanxian2.jpg" alt="Alt"><h2 id="修改文件-目录的权限的命令：chmod"><a href="#修改文件-目录的权限的命令：chmod" class="headerlink" title="修改文件/目录的权限的命令：chmod"></a>修改文件/目录的权限的命令：chmod</h2>示例：修改/test下的aaa.txt的权限为属主有全部权限，属主所在的组有读写权限，<br>其他用户只有读的权限<br>chmod u=rwx,g=rw,o=r aaa.txt<br><img src="http://pd6p053wl.bkt.clouddn.com/chmod.png" alt="Alt"><br>上述示例还可以使用数字表示：<br>chmod 764 aaa.txt</li>
</ul>
</li>
</ul>
<h2 id="切换用户"><a href="#切换用户" class="headerlink" title="切换用户"></a>切换用户</h2><p>有时候用户并不是root用户，没有权限修改文件权限<br>命令：sudo su ，然后输入密码，回车<br>root用户转回普通用户<br>命令：exit</p>

      
    </div>

    

    
    
    

    

    

    
    <div>
      
        <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">
            -------------本文结束
            <i class="fa fa-paw"></i>
            感谢您的阅读-------------
        </div>
    
</div>

      
    </div>
    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/little-eight-china.github.io/tags/little-eight/" rel="tag"># little_eight</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/little-eight-china.github.io/2018/08/21/科学上网：搬瓦工搭建shadowsocks服务端/" rel="next" title="科学上网：搬瓦工VPS搭建shadowsocks">
                <i class="fa fa-chevron-left"></i> 科学上网：搬瓦工VPS搭建shadowsocks
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/little-eight-china.github.io/2018/10/01/Spring实战笔记（一）/" rel="prev" title="Spring实战笔记（一）">
                Spring实战笔记（一） <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zODE4Ni8xNDcxNA=="></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name"></p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          
            <nav class="site-state motion-element">
              
                <div class="site-state-item site-state-posts">
                
                  <a href="/little-eight-china.github.io/archives/">
                
                    <span class="site-state-item-count">15</span>
                    <span class="site-state-item-name">日志</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-categories">
                  <a href="/little-eight-china.github.io/categories/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">4</span>
                    <span class="site-state-item-name">分类</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-tags">
                  <a href="/little-eight-china.github.io/tags/index.html">
                    
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">2</span>
                    <span class="site-state-item-name">标签</span>
                  </a>
                </div>
              
            </nav>
          

          

          
            <div class="links-of-author motion-element">
              
                <span class="links-of-author-item">
                  <a href="https://github.com/little-eight-china" target="_blank" title="GitHub"><i class="fa fa-fw fa-github"></i>GitHub</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="https://blog.csdn.net/h295928126" target="_blank" title="CSDN"><i class="fa fa-fw fa-crosshairs"></i>CSDN</a>
                  
                </span>
              
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                成人链接
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="https://acris.me/" title="acris" target="_blank">acris</a>
                  </li>
                
              </ul>
            </div>
          

          
            
          
          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Linux的基本命令入门"><span class="nav-number">1.</span> <span class="nav-text">Linux的基本命令入门</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#目录切换命令"><span class="nav-number">1.1.</span> <span class="nav-text">目录切换命令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#目录结构"><span class="nav-number">1.1.1.</span> <span class="nav-text">目录结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#目录切换命令-1"><span class="nav-number">1.1.2.</span> <span class="nav-text">目录切换命令</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#目录的操作命令"><span class="nav-number">1.2.</span> <span class="nav-text">目录的操作命令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#增加目录操作"><span class="nav-number">1.2.1.</span> <span class="nav-text">增加目录操作</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#查看目录"><span class="nav-number">1.2.2.</span> <span class="nav-text">查看目录</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#寻找目录"><span class="nav-number">1.2.3.</span> <span class="nav-text">寻找目录</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#修改目录的名称"><span class="nav-number">1.2.4.</span> <span class="nav-text">修改目录的名称</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#移动目录的位置—剪切"><span class="nav-number">1.2.5.</span> <span class="nav-text">移动目录的位置—剪切</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#拷贝目录"><span class="nav-number">1.2.6.</span> <span class="nav-text">拷贝目录</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#删除目录"><span class="nav-number">1.2.7.</span> <span class="nav-text">删除目录</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#文件的操作命令"><span class="nav-number">1.3.</span> <span class="nav-text">文件的操作命令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#文件的创建"><span class="nav-number">1.3.1.</span> <span class="nav-text">文件的创建</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#文件的查看"><span class="nav-number">1.3.2.</span> <span class="nav-text">文件的查看</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#修改文件的内容"><span class="nav-number">1.3.3.</span> <span class="nav-text">修改文件的内容</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#压缩文件的操作命令"><span class="nav-number">1.4.</span> <span class="nav-text">压缩文件的操作命令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#打包并压缩文件"><span class="nav-number">1.4.1.</span> <span class="nav-text">打包并压缩文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#解压压缩包"><span class="nav-number">1.4.2.</span> <span class="nav-text">解压压缩包</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#其他命令"><span class="nav-number">1.5.</span> <span class="nav-text">其他命令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#显示当前所在位置"><span class="nav-number">1.5.1.</span> <span class="nav-text">显示当前所在位置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#搜索命令"><span class="nav-number">1.5.2.</span> <span class="nav-text">搜索命令</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#管道命令"><span class="nav-number">1.5.3.</span> <span class="nav-text">管道命令</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#查看进程"><span class="nav-number">1.5.4.</span> <span class="nav-text">查看进程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#杀死进程"><span class="nav-number">1.5.5.</span> <span class="nav-text">杀死进程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#网络通信命令"><span class="nav-number">1.5.6.</span> <span class="nav-text">网络通信命令</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Linux的权限命令"><span class="nav-number">2.</span> <span class="nav-text">Linux的权限命令</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#权限说明"><span class="nav-number">2.1.</span> <span class="nav-text">权限说明</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#修改文件-目录的权限的命令：chmod"><span class="nav-number">2.2.</span> <span class="nav-text">修改文件/目录的权限的命令：chmod</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#切换用户"><span class="nav-number">2.3.</span> <span class="nav-text">切换用户</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      
        <div class="back-to-top">
          <i class="fa fa-arrow-up"></i>
          
        </div>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder"></span>

  

  
</div>



<!-- 统计访问数 -->
<div>
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span id="busuanzi_container_site_pv" style='display:none'>
    本站总访问量 <span id="busuanzi_value_site_pv"></span> 次
    <span class="post-meta-divider">|</span>
</span>
<span id="busuanzi_container_site_uv" style='display:none'>
    有<span id="busuanzi_value_site_uv"></span>人看过我的博客啦
</span>
</div>

        








        
      </div>
    </footer>

    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>


























  
  
    <script type="text/javascript" src="/little-eight-china.github.io/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/little-eight-china.github.io/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/little-eight-china.github.io/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  


  


  <script type="text/javascript" src="/little-eight-china.github.io/js/src/utils.js?v=6.3.0"></script>

  <script type="text/javascript" src="/little-eight-china.github.io/js/src/motion.js?v=6.3.0"></script>



  
  


  <script type="text/javascript" src="/little-eight-china.github.io/js/src/affix.js?v=6.3.0"></script>

  <script type="text/javascript" src="/little-eight-china.github.io/js/src/schemes/pisces.js?v=6.3.0"></script>



  
  <script type="text/javascript" src="/little-eight-china.github.io/js/src/scrollspy.js?v=6.3.0"></script>
<script type="text/javascript" src="/little-eight-china.github.io/js/src/post-details.js?v=6.3.0"></script>



  


  <script type="text/javascript" src="/little-eight-china.github.io/js/src/bootstrap.js?v=6.3.0"></script>



  



  





  
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
  










  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/little-eight-china.github.io/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  

  
  

  

  

  

  

  

</body>
</html>
